package com.whatech.mall.user.controller;

import com.whatech.mall.user.model.dto.UserDTO;
import lombok.extern.slf4j.Slf4j;

/**
 * UserController的降级处理类。
 */
@Slf4j
public class UserControllerFallbackClass {

    /**
     * 根据ID查询用户信息的熔断处理
     */
    public static UserDTO listFallback(Long id, Throwable t) {
        log.warn("UserController.query() block.", t);
        UserDTO userDTO = new UserDTO();
        userDTO.setId(id);
        return userDTO;
    }

}
